package com.ds.seqlist.LeetCode;

public class Num283_MoveZero {
    public void moveZeroes(int[] nums) {
        int fir = 0;
        int sec = 0;
        while (sec < nums.length) {
            if (nums[sec] != 0) {
                // nums[sec]对于的元素应该添加到我们的子区间中
                nums[fir] = nums[sec];
                fir ++;
            }
            sec ++;
        }
        for (int i = fir; i < nums.length ; i++) {
            nums[i]=0;
        }

    }
}
